import java.util.Scanner;


class TheBusDriverProblem {
	 
	public static void main(String[] args) {
	
		Scanner scanner = new Scanner(System.in);

	     while(true)
	     {
	    	 int n,d,r ;
	    	 n = scanner.nextInt();
	    	 d = scanner.nextInt();
	    	 r = scanner.nextInt();
	    	 
	    	 if(n==0 && d==0 && r==0)
	    	 {
	    		 break ;
	    	 }
	    	 
	    	 int []drivers = new int[n] ;
	    	 
	    	 for(int i=0;i<n;i++) drivers[i] = d-scanner.nextInt();
	    	   	 
	    	 int []ar = new int[n] ;
	    	 
	    	 for(int i=0;i<n;i++)  ar[i] = scanner.nextInt() ;	    	
	    	 
	    	 for(int i=0;i<n-1;i++)
	    	 {
	    		 for(int j=0;j<n-1-i;j++)
	    		 {
	    			 if(ar[j]<ar[j+1])
	    			 {
	    				 int temp = ar[j] ;
	    				 ar[j] = ar[j+1] ;
	    				 ar[j+1] = temp ;
	    			 }
	    		 }
	    	 }
	    	 
	    	 for(int i=0;i<n-1;i++)
	    	 {
	    		 for(int j=0;j<n-1-i;j++)
	    		 {
	    			 if(drivers[j]<drivers[j+1])
	    			 {
	    				 int temp = drivers[j] ;
	    				 drivers[j] = drivers[j+1] ;
	    				 drivers[j+1] = temp ;
	    			 }
	    		 }
	    	 }
	    	 
	    	 long amt = 0 ;

	    	 for(int i=0;i<n;i++)
	    	 {
	    		 drivers[i] -= ar[i] ;
	    		 if(drivers[i]<0)
	    		 {
	    			 amt += -1*drivers[i]*r ;
	    		 }
	    	 }
	    	 
	    	 System.out.println(amt);
	     }
	     scanner.close();
		
	}
}
